//
//  CSPageEngine.h
//  Pods
//
//  Created by 网新中研 on 2017/4/25.
//
//

#import <Foundation/Foundation.h>
#import "CSUIKit.h"

#define KEY_ICON_DOWN_ARROW @"KEY_DOWN_ARROW"
#define KEY_ICON_WRONG @"KEY_ICON_WRONG"
#define KEY_ICON_CORRECT @"KEY_ICON_CORRECT"
#define KEY_ICON_ARROW_MORE @"KEY_ICON_ARROW_MORE"
#define KEY_ICON_CHECKED @"KEY_ICON_CHECKED"
#define KEY_ICON_UNCHECKED @"KEY_ICON_UNCHECKED"
#define KEY_ICON_NAVIGATION_BACK @"KEY_ICON_NAVIGATION_BACK"
#define KEY_ICON_ARROW_UP @"KEY_ICON_ARROW_UP"
#define KEY_ICON_ARROW_DOWN @"KEY_ICON_ARROW_DOWN"
#define KEY_ICON_CHECK @"KEY_ICON_CHECK"
#define KEY_ICON_HISTORY @"KEY_ICON_HISTORY"
#define KEY_ICON_REMOVE @"KEY_ICON_REMOVE"
#define KEY_ICON_CHECK_DISABLE @"KEY_ICON_CHECK_DISABLE"
#define KEY_ICON_CHECK_YES @"KEY_ICON_CHECK_YES"
#define KEY_ICON_RADIO_YES @"KEY_ICON_RADIO_YES"
#define KEY_ICON_RADIO_NO @"KEY_ICON_RADIO_NO"
#define KEY_ICON_QUERY @"KEY_ICON_QUERY"
#define KEY_ICON_INFORM @"KEY_ICON_INFORM"

/**
 * 页面引擎
 */
@interface CSPageEngine : NSObject

@property (nonatomic, assign) BOOL isDevelopmentMode;

@property (nonatomic, strong, readonly) UIView *pageView;

@property (nonatomic, strong, readonly) CSPageModel *pageModel;

/**
 * 载入图片资源
 */
+(void)loadImage:(UIImage *)image forKey:(NSString *)key;

/**
 * 获取图片
 */
+(UIImage *)getImageWithKey:(NSString *)key;

/**
 * 页面引擎工厂
 */
+(id)pageEngine:(NSDictionary *)descriptor;


/**
 * 载入页面
 */
-(void)loadPage:(UIView *)superView;

/**
 * 刷新页面
 */
-(void)refreshPage;


/**
 * 实例化一个页面
 */
-(CSPageModel *)parsePage;

-(void)refreshPageValue:(id)responseObj;

/**
 * 将页面对象转化为视图
 */
-(UIView *)inflatePage:(BOOL)isNavigationBarVisible;

/**
 * 移除指定页面元素
 */
-(void)removeElement:(CSPageElementModel *)pageElementModel;

/**
 * 滚动到底部视图
 */
-(void)scrollToBottom;

/**
 * 隐藏键盘
 */
-(void)hideKeyboard;

-(void)showPage:(CSPageElementModel *)pageElementModel;

/**
 * 显示指定的视图对象:采用上下移出界面的方式显示指定的视图对象
 * @parms:pageElementModel 页面对象 点击后的页面对象
 * @parms:targetView 要显示的视图对象
 *
 */
-(void)dismissShowElement:(CSPageElementModel *)pageElementModel targetView:(UIView *)targetView;


/**
 * 显示指定的页面对象:采用上下移出界面的方式显示指定的视图对象
 * @parms:pageElementModel 页面对象 点击后的页面对象
 * @parms:pageModel 要显示的页面对象
 *
 */
-(void)dismissShowElement:(CSPageElementModel *)pageElementModel targetPage:(CSPageModel *)pageModel;

/**
 * 显示元素
 */
-(void)showElementInTheList:(CSPageElementModel *)pageElementModel targetView:(UIView *)targetView;


@end
